home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / perl5 / HTML / FormatRTF.pm < prev    next >
Encoding:
Text File  |  2004-06-02  |  16.8 KB  |  661 lines

  1.  
  2. require 5;
  3. package HTML::FormatRTF;
  4. use strict;
  5. use vars qw(@ISA $VERSION %Escape);
  6.  
  7. use HTML::Formatter ();
  8. BEGIN { *DEBUG = \&HTML::Formatter::DEBUG unless defined &DEBUG }
  9.  
  10. @ISA = qw(HTML::Formatter);
  11.  
  12. $VERSION = sprintf("%d.%02d", q$Revision: 2.04 $ =~ /(\d+)\.(\d+)/);
  13.  
  14.  
  15. sub default_values {
  16.   (
  17.      shift->SUPER::default_values(),
  18.      'lm' =>  0, # left margin
  19.      'rm' =>  0, # right margin (actually, maximum text width)
  20.  
  21.      'head1_halfpoint_size' => 32,
  22.      'head2_halfpoint_size' => 28,
  23.      'head3_halfpoint_size' => 25,
  24.      'head4_halfpoint_size' => 22,
  25.      'head5_halfpoint_size' => 20,
  26.      'head6_halfpoint_size' => 18,
  27.      'codeblock_halfpoint_size' => 18,
  28.      'header_halfpoint_size' => 17,
  29.      'normal_halfpoint_size' => 22,
  30.   );
  31. }
  32.  
  33. sub configure {
  34.   my($self,$hash) = @_;
  35.   $self->{lm} = 0;
  36.   $self->{rm} = 0;
  37.   $self;
  38. }
  39.  
  40.  
  41. sub begin {
  42.   my $self = shift;
  43.   DEBUG and print " Start document.\n";
  44.  
  45.   $self->SUPER::begin;
  46.  
  47.   $self->collect(
  48.       $self->doc_init,
  49.       $self->font_table,
  50.       $self->stylesheet,
  51.       $self->color_table,
  52.       $self->doc_info,
  53.       $self->doc_really_start,
  54.       "\n"
  55.   )
  56.    unless $self->{'no_prolog'};
  57.   
  58.   $self->{'Para'} = '';
  59.   $self->{'quotelevel'} = 0;
  60.   
  61.   return;
  62. }
  63.  
  64. sub end {
  65.   my $self = shift;
  66.   $self->vspace(0);
  67.   $self->out('THIS IS NEVER SEEN');
  68.    # just to force the previous para to be written out.
  69.  
  70.   $self->collect("}") unless $self->{'no_trailer'}; # ends the document
  71.   DEBUG and print " End document.\n";
  72.   return;
  73. }
  74.  
  75.  
  76. ###########################################################################
  77.  
  78. sub vspace {
  79.   my $self = shift;
  80.   #$self->emit_para if defined $self->{'vspace'};
  81.   my $rv = $self->SUPER::vspace(@_);
  82.   $self->emit_para if defined $self->{'vspace'};
  83.   $rv;
  84. }
  85.  
  86. ###########################################################################
  87.  
  88. sub stylesheet {
  89.  
  90.   # TODO: maybe actually /use/ the character styles?
  91.  
  92.   return sprintf <<'END',     # snazzy styles
  93. {\stylesheet
  94. {\snext0 Normal;}
  95. {\*\cs1 \additive Default Paragraph Font;}
  96. {\*\cs2 \additive \i\sbasedon1 html-ital;}
  97. {\*\cs3 \additive \b\sbasedon1 html-bold;}
  98. {\*\cs4 \additive \f1\sbasedon1 html-code;}
  99.  
  100. {\s20\ql \f1\fs%s\lang1024\noproof\sbasedon0 \snext0 html-pre;}
  101.  
  102. {\s31\ql \keepn\sb90\sa180\f2\fs%s\ul\sbasedon0 \snext0 html-head1;}
  103. {\s32\ql \keepn\sb90\sa180\f2\fs%s\ul\sbasedon0 \snext0 html-head2;}
  104. {\s33\ql \keepn\sb90\sa180\f2\fs%s\ul\sbasedon0 \snext0 html-head3;}
  105. {\s34\ql \keepn\sb90\sa180\f2\fs%s\ul\sbasedon0 \snext0 html-head4;}
  106. {\s35\ql \keepn\sb90\sa180\f2\fs%s\ul\sbasedon0 \snext0 html-head5;}
  107. {\s36\ql \keepn\sb90\sa180\f2\fs%s\ul\sbasedon0 \snext0 html-head6;}
  108. }
  109.  
  110. END
  111.  
  112.    @{ $_[0] }{qw<
  113.     codeblock_halfpoint_size
  114.     head1_halfpoint_size
  115.     head2_halfpoint_size
  116.     head3_halfpoint_size
  117.     head4_halfpoint_size
  118.     head5_halfpoint_size
  119.     head6_halfpoint_size
  120.    >}
  121.   ;
  122. }
  123.  
  124. ###########################################################################
  125. # Override these as necessary for further customization
  126.  
  127. sub font_table {
  128.   
  129.   my $self = shift;
  130.   return sprintf <<'END' ,  # text font, code font, heading font
  131. {\fonttbl
  132. {\f0\froman %s;}
  133. {\f1\fmodern %s;}
  134. {\f2\fswiss %s;}
  135. }
  136.  
  137. END
  138.  
  139.   map {;       # custom-dumb escaper:
  140.     my $x = $_;
  141.     $x =~ s/([\x00-\x1F\\\{\}\x7F-\xFF])/sprintf("\\'%02x", $1)/g;
  142.     $x =~ s/([^\x00-\xFF])/'\\uc1\\u'.((ord($1)<32768)?ord($1):(ord($1)-65536)).'?'/eg;
  143.     $x;
  144.   }
  145.     $self->{'fontname_body'} || 'Times',
  146.     $self->{'fontname_code'} || 'Courier New',
  147.     $self->{'fontname_headings'} || 'Arial',
  148.   ;
  149. }
  150.  
  151. sub doc_init {
  152.    return <<'END';
  153. {\rtf1\ansi\deff0
  154.  
  155. END
  156. }
  157.  
  158. sub color_table {
  159.    return <<'END';
  160. {\colortbl;\red255\green0\blue0;\red0\green0\blue255;}
  161. END
  162. }
  163.  
  164.  
  165. sub doc_info {
  166.    my $self = $_[0];
  167.    return sprintf <<'END', $self->version_tag;
  168. {\info{\doccomm generated by %s}
  169. {\author [see doc]}{\company [see doc]}{\operator [see doc]}
  170. }
  171.  
  172. END
  173.  
  174. }
  175.  
  176.  
  177. sub doc_really_start {
  178.   my $self = $_[0];
  179.  
  180.   return sprintf <<'END', 
  181. \deflang%s\widowctrl
  182. {\header\pard\qr\plain\f2\fs%s
  183. p.\chpgn\par}
  184. \fs%s
  185.  
  186. END
  187.     $self->{'document_language'} || 1033,
  188.     $self->{"header_halfpoint_size"},
  189.     $self->{"normal_halfpoint_size"},
  190.   ;
  191. }
  192.  
  193. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  194. sub emit_para {      # rather like showline in FormatPS
  195.   my $self = shift;
  196.  
  197.   my $para = $self->{'Para'};
  198.   $self->{'Para'} = undef;
  199.   
  200.   if(DEBUG > 4) {
  201.     printf "     &emit_para called by %s\n", (caller(1) )[3];
  202.   }
  203.   
  204.   unless( defined $para ) {
  205.    #and length $para and $para =~ m/[^ ]/
  206.     DEBUG > 20
  207.      and print "   Emit_para is a no-op because para buffer is empty.\n";
  208.     return;
  209.   }
  210.  
  211.   $para =~ s/^ +//s;
  212.   $para =~ s/ +$//s;
  213.     
  214.   if( DEBUG > 2 ) {
  215.     my $p = $para;
  216.     $p =~ tr/\n/\xB6/;
  217.     substr($p,60) = "..." if length $p > 65;
  218.     print "   Emit_para emits <$p> with vspace of ",
  219.       $self->{'vspace'} || 'nil', "\n";
  220.   }
  221.  
  222.  
  223.   # And now: a not terribly clever algorithm for inserting newlines
  224.   # at a guaranteed harmless place: after a block of whitespace
  225.   # after the 65th column.  This was copied from RTF::Writer.
  226.   $para =~
  227.     s/(
  228.        [^\cm\cj\n]{65}        # Snare 65 characters from a line
  229.        [^\cm\cj\n\x20]{0,50}  #  and finish any current word
  230.       )
  231.       (\x20{1,10})(?![\cm\cj\n]) # capture some spaces not at line-end
  232.      /$1$2\n/gx     # and put a NL before those spaces
  233.   ;
  234.   
  235.   $self->collect(
  236.     sprintf( '{\pard\sa%d\li%d\ri%d%s\plain'."\n",
  237.       #100 + 
  238.       10 * $self->{'normal_halfpoint_size'} * ($self->{'vspace'} || 0),
  239.             
  240.       $self->{'lm'},
  241.       $self->{'rm'},
  242.       
  243.       $self->{'center'} ? '\qc' : '\ql',
  244.     ),
  245.  
  246.     defined($self->{'next_bullet'}) ? do {
  247.       my $bullet = $self->{'next_bullet'};
  248.       $self->{'next_bullet'} = undef;
  249.       sprintf "\\fi-%d\n%s",
  250.         4.5 * $self->{'normal_halfpoint_size'},
  251.         ($bullet eq '*') ? "\\'95 " : (rtf_esc($bullet). ". ")
  252.     } : (),
  253.  
  254.     $para,
  255.     "\n\\par}\n\n",
  256.   );
  257.     
  258.   $self->{'vspace'} = undef; # we finally get to clear it here!
  259.  
  260.   return;
  261. }
  262.  
  263. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  264.  
  265. sub new_font_size {
  266.   my $self = $_[0];
  267.   $self->out(
  268.     \ sprintf "{\\fs%u\n",
  269.     $self->scale_font_for(
  270.       $self->{'normal_halfpoint_size'}
  271.     )
  272.   );
  273. }
  274.  
  275. sub restore_font_size { shift->out(  \ '}'  ) }
  276.  
  277. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  278.  
  279. #sub bullet {
  280. #  my $self = shift;
  281. #  $self->SUPER::bullet($_[0] . ' ');
  282. #}
  283.  
  284. sub hr_start {
  285.   my $self = shift;
  286.   # A bit of a hack:
  287.   
  288.   $self->vspace(.3);
  289.   $self->out( \ ( '\qc\ul\f1\fs20\nocheck\lang1024 ' . ('\~' x (
  290.     $self->{'hr_width'} || 50
  291.   ) ) ) );
  292.   $self->vspace(.7);
  293.   1;
  294. }
  295.  
  296.  
  297. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  298.  
  299. sub br_start {
  300.   $_[0]->out( \"\\line\n" );
  301. }
  302.  
  303. sub header_start { # for h1 ... h6's
  304.   # This really should have been called heading_start, but it's too late
  305.   #  to change now.
  306.   
  307.   my($self, $level) = @_;
  308.   DEBUG > 1 and print "  Heading of level $level\n";
  309.  
  310.   #$self->adjust_lm(0); # assert new paragraph
  311.   $self->vspace(1.5);
  312.   
  313.   $self->out( \( sprintf '\s3%s\ql\keepn\f2\fs%s\ul'."\n",
  314.     $level,
  315.     $self->{'head' . $level .'_halfpoint_size'},
  316.     $level,
  317.   ));
  318.   
  319.   return 1;
  320. }
  321.  
  322. sub header_end {
  323.   # This really should have been called heading_end but it's too late
  324.   #  to change now.
  325.   
  326.   $_[0]->vspace(1);
  327.   1;
  328. }
  329.  
  330. sub bullet {
  331.   my($self, $bullet) = @_;
  332.   $self->{'next_bullet'} = $bullet;
  333.   return;
  334. }
  335.  
  336. sub adjust_lm {
  337.   $_[0]->emit_para();
  338.   $_[0]->{'lm'} += $_[1] * $_[0]->{'normal_halfpoint_size'} * 5;
  339.   1;
  340. }
  341. sub adjust_rm {
  342.   $_[0]->emit_para();
  343.   $_[0]->{'rm'} -= $_[1] * $_[0]->{'normal_halfpoint_size'} * 5;
  344.   1;
  345. }   # Yes, flip the sign on the right margin!
  346.  
  347.     # BTW, halfpoints * 10 = twips
  348.  
  349. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  350.  
  351. sub pre_start {
  352.   my $self = shift;
  353.   $self->SUPER::pre_start(@_);
  354.   $self->out( \ sprintf
  355.     '\s20\f1\fs%s\noproof\lang1024\lang1076 ',
  356.     $self->{'codeblock_halfpoint_size'},
  357.   );
  358.   return 1;
  359. }
  360.  
  361. ###########################################################################
  362.  
  363. sub  b_start  { shift->out( \'{\b ' ) }
  364. sub  b_end    { shift->out( \'}'    ) }
  365. sub  i_start  { shift->out( \'{\i ' ) }
  366. sub  i_end    { shift->out( \'}'    ) }
  367.  
  368. sub tt_start  { shift->out( \'{\f1\noproof\lang1024\lang1076 ' ) }
  369.                  # really really really don't spellcheck this bit!
  370. sub tt_end    { shift->out( \'}'    ) }
  371.  
  372.  
  373. sub sub_start     { shift->out( \'{\sub '   ) }
  374. sub sub_end       { shift->out( \'}'        ) }
  375. sub sup_start     { shift->out( \'{\super ' ) }
  376. sub sup_end       { shift->out( \'}'        ) }
  377.  
  378. sub strike_start  { shift->out( \'{\strike ') }
  379. sub strike_end    { shift->out( \'}'        ) }
  380.  
  381. sub q_start  {
  382.   my $self = $_[0];
  383.   $self->out(
  384.     ( ( ++ $self->{'quotelevel'} ) % 2)  ?  \'\ldblquote '  :  \'\lquote '
  385.   );
  386. }
  387.  
  388. sub q_end    {
  389.   my $self = $_[0];
  390.   $self->out(
  391.     ( ( -- $self->{'quotelevel'} ) % 2)  ?  \'\rquote '  :  \'\rdblquote '
  392.   );
  393. }
  394.  
  395. ###########################################################################
  396.  
  397. sub pre_out { $_[0]->out(  ref($_[1]) ? $_[1] : \ rtf_esc_codely($_[1])  ) }
  398.  
  399.  
  400. sub out { # output a word (or, if escaped, chunk of RTF)
  401.   my $self = shift;
  402.   #return $self->pre_out(@_) if $self->{pre};
  403.  
  404.   if(DEBUG > 4) {
  405.     printf "     &out(%s) called by %s\n", $_[0], (caller(1) )[3];
  406.   }
  407.  
  408.   return unless defined $_[0]; # and length $_[0];
  409.  
  410.   $self->{'Para'} = '' unless defined $self->{'Para'};
  411.   $self->{'Para'} .= ref($_[0]) ? ${$_[0]} : rtf_esc($_[0]);
  412.  
  413.   if( DEBUG > 4 ) {
  414.     my $x = ref($_[0]) ? ${$_[0]} : rtf_esc($_[0]);
  415.     $x =~ s/\n/\n\t\xB6/g;
  416.     substr($x,60) = "..." if length $x > 65;
  417.     print "    Queued for output: <$x>\n";
  418.   }
  419.  
  420.   return 1;
  421. }
  422.  
  423.  
  424. ###########################################################################
  425.  
  426. use integer;
  427. sub rtf_esc {
  428.   my $x; # scratch
  429.   if(!defined wantarray) { # void context: alter in-place!
  430.     for(@_) {
  431.       s/([F\x00-\x1F\-\\\{\}\x7F-\xFF])/$Escape{$1}/g;  # ESCAPER
  432.       s/([^\x00-\xFF])/'\\uc1\\u'.((ord($1)<32768)?ord($1):(ord($1)-65536)).'?'/eg;
  433.     }
  434.     return;
  435.   } elsif(wantarray) {  # return an array
  436.     return map {; ($x = $_) =~
  437.       s/([F\x00-\x1F\-\\\{\}\x7F-\xFF])/$Escape{$1}/g;  # ESCAPER
  438.       $x =~ s/([^\x00-\xFF])/'\\uc1\\u'.((ord($1)<32768)?ord($1):(ord($1)-65536)).'?'/eg;
  439.              # Hyper-escape all Unicode characters.
  440.       $x;
  441.     } @_;
  442.   } else { # return a single scalar
  443.     ($x = ((@_ == 1) ? $_[0] : join '', @_)
  444.     ) =~ s/([F\x00-\x1F\-\\\{\}\x7F-\xFF])/$Escape{$1}/g;  # ESCAPER
  445.              # Escape \, {, }, -, control chars, and 7f-ff.
  446.     $x =~ s/([^\x00-\xFF])/'\\uc1\\u'.((ord($1)<32768)?ord($1):(ord($1)-65536)).'?'/eg;
  447.              # Hyper-escape all Unicode characters.
  448.     return $x;
  449.   }
  450. }
  451.  
  452. sub rtf_esc_codely {
  453.   # Doesn't change "-" to hard-hyphen, nor apply computerese style
  454.   
  455.   my $x; # scratch
  456.   if(!defined wantarray) { # void context: alter in-place!
  457.     for(@_) {
  458.       s/([F\x00-\x1F\\\{\}\x7F-\xFF])/$Escape{$1}/g;
  459.       s/([^\x00-\xFF])/'\\uc1\\u'.((ord($1)<32768)?ord($1):(ord($1)-65536)).'?'/eg;
  460.              # Hyper-escape all Unicode characters.
  461.     }
  462.     return;
  463.   } elsif(wantarray) {  # return an array
  464.     return map {; ($x = $_) =~
  465.       s/([F\x00-\x1F\\\{\}\x7F-\xFF])/$Escape{$1}/g;
  466.       $x =~ s/([^\x00-\xFF])/'\\uc1\\u'.((ord($1)<32768)?ord($1):(ord($1)-65536)).'?'/eg;
  467.              # Hyper-escape all Unicode characters.
  468.       $x;
  469.     } @_;
  470.   } else { # return a single scalar
  471.     ($x = ((@_ == 1) ? $_[0] : join '', @_)
  472.     ) =~ s/([F\x00-\x1F\\\{\}\x7F-\xFF])/$Escape{$1}/g;
  473.              # Escape \, {, }, -, control chars, and 7f-ff.
  474.     $x =~ s/([^\x00-\xFF])/'\\uc1\\u'.((ord($1)<32768)?ord($1):(ord($1)-65536)).'?'/eg;
  475.              # Hyper-escape all Unicode characters.
  476.     return $x;
  477.   }
  478. }
  479.  
  480. %Escape = (
  481.   map( (chr($_),chr($_)),       # things not apparently needing escaping
  482.        0x20 .. 0x7E ),
  483.   map( (chr($_),sprintf("\\'%02x", $_)),    # apparently escapeworthy things
  484.        0x00 .. 0x1F, 0x5c, 0x7b, 0x7d, 0x7f .. 0xFF, 0x46),
  485.  
  486.   # We get to escape out 'F' so that we can send RTF files thru the mail
  487.   # without the slightest worry that paragraphs beginning with "From"
  488.   # will get munged.
  489.  
  490.   # And some refinements:
  491.   #"\n"   => "\n\\line ",
  492.   #"\cm"  => "\n\\line ",
  493.   #"\cj"  => "\n\\line ",
  494.  
  495.   "\t"   => "\\tab ",     # Tabs (altho theoretically raw \t's are okay)
  496. # "\f"   => "\n\\page\n", # Formfeed
  497.   "-"    => "\\_",        # Turn plaintext '-' into a non-breaking hyphen
  498.   "\xA0" => "\\~",        # Latin-1 non-breaking space
  499.   "\xAD" => "\\-",        # Latin-1 soft (optional) hyphen
  500.  
  501.   # CRAZY HACKS:
  502.   "\n" => "\\line\n",
  503.   "\r" => "\n",
  504. # "\cb" => "{\n\\cs21\\lang1024\\noproof ",  # \\cf1
  505. # "\cc" => "}",
  506. );
  507.  
  508.  
  509.  
  510. 1;
  511.  
  512. __END__
  513.  
  514. =head1 NAME
  515.  
  516. HTML::FormatRTF - Format HTML as RTF
  517.  
  518. =head1 SYNOPSIS
  519.  
  520.   use HTML::FormatRTF;
  521.  
  522.   my $out_file = "test.rtf";
  523.   open(RTF, ">$out_file")
  524.    or die "Can't write-open $out_file: $!\nAborting";
  525.    
  526.   print RTF HTML::FormatRTF->format_file(
  527.     'test.html',
  528.       'fontname_headings' => "Verdana",
  529.   );
  530.   close(RTF);
  531.  
  532. =head1 DESCRIPTION
  533.  
  534. HTML::FormatRTF is a class for objects that you use to convert HTML to
  535. RTF.  There is currently no proper support for tables or forms.
  536.  
  537. This is a subclass of L<HTML::Formatter>, whose documentation you should
  538. consult for more information on the new, format, format_file 
  539.  
  540. You can specify any of the following parameters in the call to C<new>,
  541. C<format_file>, or C<format_string>:
  542.  
  543. =over
  544.  
  545. =item lm
  546.  
  547. Amount of I<extra> indenting to apply to the left margin, in twips
  548. (I<tw>entI<i>eths of a I<p>oint). Default is 0.
  549.  
  550. So if you wanted the left margin to be an additional half inch larger,
  551. you'd set C<< lm => 720 >> (since there's 1440 twips in an inch).
  552. If you wanted it to be about 1.5cm larger, you'd set 
  553. C<< lw => 850 >> (since there's about 567 twips in a centimeter).
  554.  
  555. =item rm
  556.  
  557. Amount of I<extra> indenting to apply to the left margin, in twips
  558. (I<tw>entI<i>eths of a I<p>oint).  Default is 0.
  559.  
  560. =item normal_halfpoint_size
  561.  
  562. This is the size of normal text in the document, in I<half>-points.
  563. The default value is 22, meaning that normal text is in 11 point.
  564.  
  565. =item header_halfpoint_size
  566.  
  567. This is the size of text used in the document's page-header, in
  568. I<half>-points. The default value is 17, meaning that normal text is in
  569. 7.5 point.  Currently, the header consists just of "p.I<pagenumber>"
  570. in the upper-right-hand corner, and cannot be disabled.
  571.  
  572. =item head1_halfpoint_size ... head6_halfpoint_size
  573.  
  574. These control the font size of each heading level, in half-twips.  For
  575. example, the default for head3_halfpoint_size is 25, meaning that HTML
  576. C<< <h3>...</h3> >> text will be in 12.5 point text (in addition to being
  577. underlined and in the heading font).
  578.  
  579. =item codeblock_halfpoint_size
  580.  
  581. This controls the font size (in half-points) of the text used for 
  582. C<< <pre>...</pre> >> text.  By default, it is 18, meaning 9 point.
  583.  
  584.  
  585.  
  586. =item fontname_body
  587.  
  588. This option controls what font is to be used for the body of the
  589. text -- that is, everything other than heading text and text in
  590. pre/code/tt elements. The default value is currently "Times".  Other
  591. handy values I can suggest using are "Georgia" or "Bookman Old Style".
  592.  
  593. =item fontname_code
  594.  
  595. This option controls what font is to be used for text in pre/code/tt
  596. elements. The default value is currently "Courier New".
  597.  
  598. =item fontname_headings
  599.  
  600. This option controls what font name is to be used for headings.  You can
  601. use the same font as fontname_body, but I prefer a sans-serif font, so
  602. the default value is currently "Arial".  Also consider
  603. "Tahoma" and "Verdana".
  604.  
  605.  
  606. =item document_language
  607.  
  608. This option controls what Microsoft language number will be specified as
  609. the language for this document. The current default value is 1033, for
  610. US English. Consult an RTF reference for other language numbers.
  611.  
  612. =item hr_width
  613.  
  614. This option controls how many underline characters will be used for
  615. rendering a "<hr>" tag. Its default value is currently 50. You can
  616. usually leave this alone, but under some circumstances you might want to
  617. use a smaller or larger number.
  618.  
  619.  
  620. =item no_prolog
  621.  
  622. If this option is set to a true value, HTML::FormatRTF will make a point of
  623. I<not> emitting the RTF prolog before the document.  By default, this is
  624. off, meaning that HTML::FormatRTF I<will> emit the prolog.  This option
  625. is of interest only to advanced users.
  626.  
  627. =item no_trailer
  628.  
  629. If this option is set to a true value, HTML::FormatRTF will make a point of
  630. I<not> emitting the RTF trailer at the end of the document.  By default,
  631. this is off, meaning that HTML::FormatRTF I<will> emit the bit of RTF
  632. that ends the document.  This option is of interest only to advanced
  633. users.
  634.  
  635.  
  636. =back
  637.  
  638.  
  639. =head1 SEE ALSO
  640.  
  641. L<HTML::Formatter>, L<RTF::Writer>
  642.  
  643. =head1 COPYRIGHT
  644.  
  645. Copyright (c) 2002 Sean M. Burke.  All rights reserved.
  646.  
  647. This library is free software; you can redistribute it and/or
  648. modify it under the same terms as Perl itself.
  649.  
  650. This program is distributed in the hope that it will be useful, but
  651. without any warranty; without even the implied warranty of
  652. merchantability or fitness for a particular purpose.
  653.  
  654. =head1 AUTHOR
  655.  
  656. Sean M. Burke C<< <sburke@cpan.org> >>
  657.  
  658. =cut
  659.  
  660.  
  661.